//
//  MSAllListCollectionCell.m
//  MSJD
//
//  Created by 箭军刘 on 2018/10/26.
//  Copyright © 2018年 xiangbo. All rights reserved.
//

#import "MSAllListCollectionCell.h"

#import "MSTypeBView.h"
#import "MSTitleView.h"

@interface MSAllListCollectionCell()

@property (nonatomic, strong)MSTitleView *titleView;
@property (nonatomic, strong)MSTypeBView *showView;

@property (nonatomic, strong) MSFoodData *data;

@end

@implementation MSAllListCollectionCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self initSubViews];
    }
    return self;
}

- (void)initSubViews {
    self.titleView = [[MSTitleView alloc] init];
    [self.contentView addSubview:self.titleView];
    
    self.showView = [[MSTypeBView alloc] init];
    [self.contentView addSubview:self.showView];
    
    [self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.and.right.equalTo(self);
        make.height.mas_equalTo(44.f);
    }];
    
    [self.showView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.titleView.mas_bottom);
        make.left.equalTo(self).offset(11);
        make.right.equalTo(self).offset(-11);
        make.bottom.equalTo(self);
    }];
}

- (void)refreshCollectionCellWithData:(MSFoodData *)data {
    self.data = data;
    [self.titleView refreshTitle:data];
}

@end
